package com.vote.admin.controller;

import com.vote.common.returns.RespEntity;
import com.vote.admin.service.VoteUserLoginService;
import com.vote.admin.vo.param.LoginParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

/**
 * <p>
 * 用户投票系统登陆页 前端控制器
 * </p>
 *
 * @author gyg
 * @since 2021-05-18
 */
@RestController
@RequestMapping("/user-login")
@Slf4j
@Api(value = "用户投票系统登陆页", tags = "用户投票系统登陆页")
public class VoteUserLoginController {

    @Resource
    private VoteUserLoginService voteUserLoginService;

    @PostMapping("/login")
    @ApiOperation(value = "登陆")
    public RespEntity login(LoginParam loginParam, HttpSession session) {
        RespEntity respEntity = voteUserLoginService.login(loginParam, session);
        return respEntity;
    }

}
